var fs = require('fs');
var arr = new Array();
for(var i = 1;i <= 100;i++){
    arr[i-1] =Math.ceil(Math.random()*1001);
    fs.writeFile(
        i+'.txt',
        ''+arr[i-1],
            (err)=>{
                if(err){
                    console.log(err)
                }
            }

    )
}